/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import model.Projectstatus;

/**
 *
 * @author HuyNVK
 */
@Stateless
public class ProjectstatusFacade extends AbstractFacade<Projectstatus> implements ProjectstatusFacadeRemote {
    @PersistenceContext(unitName = "ejb-servPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public ProjectstatusFacade() {
        super(Projectstatus.class);
    }

    @Override
    public Projectstatus merge(Projectstatus projectstatus) {
        return em.merge(projectstatus);
    }

    @Override
    public void deleteByID(String id) {
        Projectstatus status = find(id);
        status = em.merge(status);
        em.remove(status);
    }

    @Override
    public void insert(Projectstatus projectstatus) {
        em.persist(projectstatus);
    }
    
}
